import axios from '@/utils/request'

export const getChannelList = () => {
  return axios({
    method: 'get',
    url: '/v1_0/user/channels'
  })
}

/* 获取所有的频道 */
export const getAllChannelList = () => {
  return axios({
    method: 'get',
    url: '/v1_0/channels'
  })
}

/* 增加频道 部分覆盖 */
export const addChannel = channel => {
  return axios({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels: [channel]
    }
  })
}
export const delChannel = id => {
  return axios({
    method: 'delete',
    url: '/v1_0/user/channels/' + id
  })
}
/* 增加频道 重置式 */
export const setChannels = channels => {
  return axios({
    method: 'put',
    url: '/v1_0/user/channels',
    data: {
      channels: channels
    }
  })
}
